<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="css/tabla.css" rel="stylesheet" type="text/css">
<title>Mostrar Comedor</title>
<script src="js/comedor.js" language="JavaScript" charset="UTF-8"> </script>
<%@ page import="com.guarderia.bean.MenuBean,com.guarderia.bean.PerfilBean,java.util.*,com.guarderia.utils.UtilidadesGenerales" %>
<%!
ArrayList comidas;
MenuBean comida;
PerfilBean perfil;
String visible;
%>
<%
comidas = session.getAttribute("comidas") != null ? (ArrayList)session.getAttribute("comidas") : new ArrayList();
perfil = session.getAttribute("perfil") != null ? (PerfilBean)session.getAttribute("perfil") : new PerfilBean();
if ("Administrador".equalsIgnoreCase(perfil.getNombre())){
	visible = "";
}
else{
	visible = "class='capa_oculta'";
}
%>
</head>
<body>
<div class="texto">
	<form id="formularioMenu" method="post" action="Controlador">
	<input type="hidden" name="numeroMenu"/>
	<input type="hidden" name="opcion"/>	
			<%
						for (int i=0; i<comidas.size(); i++){
						comida = (MenuBean)comidas.get(i);
				%>
				<fieldset>
			<legend> <%=UtilidadesGenerales.convertirGregorianCalendarEnString(comida.getFecha()) %></legend>
			<p>
				<label for="primerPlato">Primer Plato:</label>
				<input name="primerPlato" readonly="readonly" type="text" maxlength="50" size="60" value ="<%=comida.getPrimerPlato()%>"/>
			</p>
			<p>
				<label for="segundoPlato">Segundo Plato:</label>
				<input name="segundoPlato" readonly="readonly" type="text" maxlength="50" size="60" value ="<%=comida.getSegundoPlato()%>"/>
			</p>
			<p>
				<label for="postre">Postre:</label>
				<input name="postre" readonly="readonly" type="text" maxlength="50" size="60" value ="<%=comida.getPostre()%>"/>
			</p>
			<div <%=visible%>>
			<p>
				<input type="button" value="modificar" onclick="ventanaModificarMenu('<%=i%>')">
				<input type="button" value="eliminar" onclick="eliminarMenu('<%=i%>')">
			</p>
			</div>
		</fieldset>
			<%} %>
	</form>
	<div class="capa_boton_centrado">
		<input type="button" value="Volver" onclick="javascript:volver2('formularioMenu');">
	</div>
</div>
</body>
</html>